--Execute as sys
SET SERVEROUTPUT ON

DECLARE
 error_count PLS_INTEGER := 0;
BEGIN
  DBMS_REDEFINITION.START_REDEF_TABLE
    ('OE', 'product_descriptions', 'product_descriptions_interim',
     'product_id product_id, detailed_product_info detailed_product_info',
      OPTIONS_FLAG => DBMS_REDEFINITION.CONS_USE_ROWID);
  DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS
    ('OE', 'product_descriptions', 'product_descriptions_interim', 
      1, true,true,true,false, error_count);
  DBMS_OUTPUT.PUT_LINE('Errors := ' || TO_CHAR(error_count));
  DBMS_REDEFINITION.FINISH_REDEF_TABLE
    ('OE', 'product_descriptions', 'product_descriptions_interim');
END;
/
